package com.xizi.leetcode周赛;

public class _6_20_1 {
    public static void main(String[] args) {
        String num = "35427";
        String s = largestOddNumber(num);
        System.out.println(s);

    }

    public static String largestOddNumber(String num) {
        for (int i = num.length() - 1; i >= 0; i--) {
            if (num.charAt(i) % 2 == 1) {
                return num.substring(0, i + 1);
            }
        }
        return "";
    }
}
